﻿//-----------------------------------------------------------------------
// <copyright file="Slot.cs" company="tuliprules.org">
//     Copyright (c) 2010 tuplelister, tuliprules.org.
// </copyright>
// <summary>This is the Slot class.</summary>
//-----------------------------------------------------------------------

namespace Tulip.Engine.Models.ClosedWorld
{
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Reflection;
    using Collections;

    /// <summary>
    /// Represents an attribute of a tuple.
    /// </summary>
    public class Slot : ElementBase
    {
                /// <summary>
        /// Initializes a new instance of the Frame class.
        /// </summary>
        public Slot()
        {
            this.Values = new Values();
        }

        /// <summary>
        /// Gets or sets the position of slot.   Used only for ordered tuples.
        /// </summary>
        public int Position { get; set; }

        /// <summary>
        /// Gets or sets the member to which the slot is bound.
        /// </summary>
        public string BoundMember { get; set; }

        /// <summary>
        /// Represents a reciprocal relationship between two slots.
        /// </summary>
        public string InverseSlot { get; set; }

        /// <summary>
        /// The type of the values.
        /// </summary>
        public ValueType ValueType { get; set; }

        /// <summary>
        /// Numeric minimum value allowed for values.
        /// </summary>
        public double Minimum { get; set; }

        /// <summary>
        /// Numeric maximum value allowed for values.
        /// </summary>
        public double Maximum { get; set; }

        /// <summary>
        /// The minimum and maximum bounds on the number of times a slot can appear on the frame.
        /// </summary>
        public Cardinality Cardinality { get; set; }

        ///////// <summary>
        ///////// Gets or sets a value indicating whether the attribute value will be cached at runtime.
        ///////// </summary>
        //////public bool Cache { get; set; }

        ///////// <summary>
        ///////// Gets or sets a value indicating whether the tuples are indexed by values of this attribute.
        ///////// </summary>
        //////public bool IndexedBy { get; set; }

        /// <summary>
        /// Gets the collection of slot definitions for this tuple type.
        /// </summary>
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
        // ReSharper disable UnusedAutoPropertyAccessor.Local
        public IList<Value> Values { get; private set; }
        // ReSharper restore UnusedAutoPropertyAccessor.Local
    }
}
